<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>客服资料</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/static/layui/css/layui.css" media="all">
</head>
<body style="padding: 0 10px;">

<blockquote class="layui-elem-quote layui-text" style="margin-top: 10px;">客服资料</blockquote>

<table class="layui-table" lay-skin="line">
    <colgroup>
        <col width="150">
        <col>
    </colgroup>
    <thead>
    <tr>
        <th>项目</th>
        <th>信息</th>
    </tr>
    </thead>
    <tbody>
    <tr>
        <td>ID</td>
        <td>{$staff.id}</td>
    </tr>
    <tr>
        <td>状态</td>
        <td>{eq name="$staff.open" value="1"}启用{else/}禁用{/eq}</td>
    </tr>
    <tr>
        <td>名称</td>
        <td>{$staff.name}</td>
    </tr>
    <tr>
        <td>性别</td>
        <td>
            {switch name="$staff.sex"}
            {case value="0"}保密{/case}
            {case value="1"}男{/case}
            {case value="2"}女{/case}
            {/switch}
        </td>
    </tr>
    <tr>
        <td>用户名</td>
        <td>{$staff.user_name}</td>
    </tr>
    <tr>
        <td>当前接待访客</td>
        <td>{$staff.work} 位</td>
    </tr>
    <tr>
        <td>权限</td>
        <td>{eq name="$staff.power" value="1"}管理{else/}客服{/eq}</td>
    </tr>
    <tr>
        <td>创建时间</td>
        <td>{$staff.create_time}</td>
    </tr>
    <tr>
        <td>修改时间</td>
        <td>{$staff.update_time}</td>
    </tr>
    <tr>
        <td>描述</td>
        <td>
            <div style="word-wrap: break-word; word-break: normal; width: 500px;">{$staff.description}</div>
        </td>
    </tr>
    <tr>
        <td>操作</td>
        <td>
            <a href="/index.php/staff/Staff_Manage/index" class="layui-btn layui-btn-sm">返回</a>
            <a href="/index.php/staff/Staff_Manage/updateStaff/id/{$staff.id}" class="layui-btn layui-btn-normal layui-btn-sm">修改</a>
            {eq name="$staff.power" value="0"}
            <button id="update" class="layui-btn layui-btn-danger layui-btn-sm">删除</button>
            {/eq}
        </td>
    </tr>
    </tbody>
</table>

<script src="/static/layui/layui.js" charset="utf-8"></script>
<script>
    layui.use('layer', function () {
        var layer = layui.layer;
        var $ = layui.$;

        $(function () {
            $('#update').click(function () {
                layer.confirm('确定删除“{$staff.name}”？', function (index) {
                    layer.close(index);
                    $.get('/index.php/staff/Staff_Manage/delStaff/id/{$staff.id}');
                    location.href = '/index.php/staff/Staff_Manage/index';
                });
            });
        });
    });
</script>
</body>
</html>